package com.fox.demo2;

public class Goods {
    private String name;

    public Goods(String name) {       //定义构造方法为成员变量赋值
        this.name = name;
    }

    public String getName() {
        return this.name;                  //this可以省略
    }

    public void setName(String name) {
        this.name = name;
    }
}
